import { request, httpDownload } from '@/utils/request'
// get 请求应 json post 请求用 FromData 格式

export class QuotationsApi {
	/**
	 * @description 获取报价组
	 * @return {HttpResponse} result
	 */
	static async groupList(data) {
	    return request('/api/buyer/v1/requirement/company/group', data)
	}
	
	/**
	 * @description 创建报价组
	 * @return {HttpResponse} result
	 */
	static async createGroup(data) {
	    return request('/api/buyer/v1/requirement/create', data, "POST")
	}
	
    /**
     * @description 获取需求项目
     * @return {HttpResponse} result
     */
    static async quotationsList(data) {
        return request('/api/buyer/v1/requirement', data)
    }
    /**
    * @description 获取需求项目详情
    * @return {HttpResponse} result
    */
    static async quotationsInfo(data: {}) {
        return request('/api/buyer/v1/requirement/detail', data)
    }
    /**
     * @description 报价单记录
     * @return {HttpResponse} result
     */
    static async quotationsRecords(data: {}) {
        return request('/api/buyer/v1/quotation/records', data)
    }
    /**
    * @description 报价单详情
    * @return {HttpResponse} result
    */
    static async RecordsInfo(data: {}) {
        return request('/api/buyer/v1/quotation/detail', data)
    }
	
	/**
	* @description 报价单
	* @return {HttpResponse} result
	*/
	static async moveQuotations(data: {}) {
	    return request('/api/buyer/v1/requirement/quotation/move', data, "POST")
	}
	
	
	/**
	* @description 报价单
	* @return {HttpResponse} result
	*/
	static async deleteQuotations(data: {}) {
	    return request('/api/buyer/v1/quotation/delete', data, "POST")
	}

    static async quotationProductOperate(data: {}) {
        return request('/api/buyer/v1/quotation/product/operate', data, 'POST')
    }

    static async updateQuotationProduct(data: {}) {
        return request('/api/buyer/v1/quotation/product/update', data, 'POST')
    }

    static async getRequireSummery(data: {}) {
        return request('/api/buyer/v1/requirement/detail/summary', data)
    }

    static async getRequireQuery(data: {}) {
        return request('/api/buyer/v1/requirement/detail/query', data)
    }

    static async getFile(data: {}) {
        return request('/api/buyer/v1/quotation/file', data)
    }

    static async selectOthers(data: {}) {
        return request('/api/buyer/v1/quotation/product/select', data, 'POST')
    }

    static async downloadQuotation(data: {}) {
        return httpDownload('/api/buyer/v1/requirement/quotation/print', data)
    }

    static async getImageData(data:{}){
        return request(data.url)
    }
	
	static async uploadInquiry(data: {}) {
        return request('/api/buyer/v1/upload/inquiry', data, 'POST')
    }
	
	static async uploadQuotation(data: {}) {
	    return request('/api/buyer/v1/upload/quotation', data, 'POST')
	}
	
	static async assignSupplier(data: {}) {
	    return request('/api/buyer/v1/quotation/file/assign/supplier', data, 'POST')
	}

    // 获取文件询盘查询接口
    static async quotationFileQuery(data:{}){
        return request('/api/buyer/v1/quotation/file/query',data,'GET')
    }
	
}